#ifndef _CONFIG_H
#define _CONFIG_H


struct timeType {
    int time;
    int type;
};

struct InterTime {
    struct timeType cpu;
    struct timeType mem;
    struct timeType disk;
    struct timeType proc;
    struct timeType sys;
    struct timeType user;
};

struct RabbitMQConfig {
    char RabbitMQIp[20];
    int RabbitMQPort;
//    char exchaneName[128];
//    char queueName[128];
};

struct MysqlConfig {
    char MysqlIp[20];
    int MysqlPort;
};

struct Config {
    char hostName[128];
    char ipAddress[20];
    char masterIp[20];
    int masterPort;
    struct InterTime interTime;
    int nworker;
    struct RabbitMQConfig rabbitCon;
};

struct ConfigServer {
    struct MysqlConfig myaqlCon;
    struct RabbitMQConfig rabbitCon;
};

int init_config(struct Config *config);
int get_config(const char *file, struct Config *config);
void init_config_server(struct ConfigServer *config);
int get_config_server(const char *file, struct ConfigServer *config);

#endif
